package com.EAIPClub.CodeShell.controller;

import com.EAIPClub.CodeShell.service.CodeShellDebugService;
import com.api.POJO.CodeLab.CodeShell.CodeShellDebugInfo;
import com.api.POJO.CodeLab.CodeShell.CodeShellDebugReturnMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description :
 * @Author :
 * @Date : 2021/12/19
 */
@RestController
public class CodeShellDebugController {

    private CodeShellDebugService service;

    @Autowired
    public void setService(CodeShellDebugService service) {
        this.service = service;
    }

    @GetMapping("/codeshell/debug/debugrun")
    public CodeShellDebugReturnMsg runDebug(@RequestParam String mainName,@RequestParam String line,@RequestParam String arrName){
        CodeShellDebugInfo info = new CodeShellDebugInfo(mainName,line,arrName);
        return service.runDebug(info);

    }
    @GetMapping("/codeshell/debug/next")
    public CodeShellDebugReturnMsg next(){
        return service.next();
    }
    @GetMapping("/codeshell/debug/showlist")
    public CodeShellDebugReturnMsg showList(){
        return service.showList();
    }
    @GetMapping("/codeshell/debug/run")
    public CodeShellDebugReturnMsg run(){
        return service.run();
    }
    @GetMapping("/codeshell/debug/exit")
    public CodeShellDebugReturnMsg exit(){
        return service.exit();
    }
}
